<template>
  <div class="table-foorter" v-if="total > 0">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="formInline.page"
      :page-sizes="[5,10, 20, 50]"
      :page-size="formInline.pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 0,
    },
    pageSize: {
      type: Number,
      default: 10,
    },
  },
  data() {
    return {
      formInline: {
        page: 1,
        psize: this.pageSize,
      },
    };
  },
  methods: {
    handleSizeChange(val) {
      console.log('handleSizeChange',val)
      this.formInline.psize = val;
      this.$emit("changpage", this.formInline);
    },
    handleCurrentChange(val) {
        console.log(val)
      this.formInline.page = val;
      this.$emit("changpage", this.formInline);
    },
  },
};
</script>

<style>
</style>